﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Blacklight.Controls">

    <!-- ********** TEXT STYLES ********** -->
    <!-- DropShadowTextBlock style -->
    <Style TargetType="local:DropShadowTextBlock">
        <Setter Property="Text" Value="DropShadowTextBlock" />
        <Setter Property="DropShadowColor" Value="#ff000000" />
        <Setter Property="DropShadowOpacity" Value="0.5" />
        <Setter Property="DropShadowAngle" Value="45" />
        <Setter Property="DropShadowDistance" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DropShadowTextBlock">
                    <Grid Background="{TemplateBinding Background}">

                        <TextBlock Text="{TemplateBinding Text}"
                                   TextDecorations="{TemplateBinding TextDecorations}"
                                   TextWrapping="{TemplateBinding TextWrapping}"
                                   IsHitTestVisible="False"
                                   >
                            <TextBlock.Foreground>
                                <SolidColorBrush x:Name="PART_DropShadowBrush" />
                            </TextBlock.Foreground>
                            <TextBlock.RenderTransform>
                                <TranslateTransform X="2" Y="2" x:Name="PART_DropShadowTranslate" />
                            </TextBlock.RenderTransform>
                        </TextBlock>

                        <TextBlock
                               Text="{TemplateBinding Text}"
                               TextDecorations="{TemplateBinding TextDecorations}"
                               TextWrapping="{TemplateBinding TextWrapping}"
                               />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ********** BORDER STYLES ********** -->
    <!-- RadialShadowBorder style -->
    <Style TargetType="local:RadialShadowBorder">
        <Setter Property="RadialShadowColor" Value="#ff000000" />
        <Setter Property="RadialShadowOpacity" Value="0.5" />
        <Setter Property="RadialShadowWidth" Value="1.25" />
        <Setter Property="RadialShadowSpread" Value="0" />
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RadialShadowBorder">
                    <Grid>

                        <Ellipse x:Name="PART_Shadow" Height="30" Margin="0,0,0,-15" VerticalAlignment="Bottom"
                                 Opacity="{TemplateBinding RadialShadowOpacity}" RenderTransformOrigin="0.5,0.5">
                            <Ellipse.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform x:Name="PART_ShadowScale" />
                                    <TranslateTransform x:Name="PART_ShadowTranslate" />
                                </TransformGroup>
                            </Ellipse.RenderTransform>
                            <Ellipse.Fill>
                                <RadialGradientBrush>
                                    <GradientStop Color="#ff000000" Offset="0" x:Name="PART_ShadowInnerStop" />
                                    <GradientStop Color="#00000000" Offset="1" x:Name="PART_ShadowOuterStop" />
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>

                        <local:ClippingBorder Background="{TemplateBinding Background}" 
                                CornerRadius="{TemplateBinding CornerRadius}" 
                                Padding="{TemplateBinding Padding}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                ClipContent="{TemplateBinding ClipContent}">
                            <ContentPresenter />
                        </local:ClippingBorder>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DropShadowBorder style -->
    <Style TargetType="local:DropShadowBorder">
        <Setter Property="DropShadowOpacity" Value="0.5" />
        <Setter Property="DropShadowColor" Value="#ff000000" />
        <Setter Property="DropShadowAngle" Value="45" />
        <Setter Property="DropShadowDistance" Value="20" />
        <Setter Property="DropShadowSpread" Value="0" />
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DropShadowBorder">
                    <Grid>
                        <Border Opacity="{TemplateBinding DropShadowOpacity}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                   CornerRadius="{TemplateBinding ShadowCornerRadius}" IsHitTestVisible="False" RenderTransformOrigin="0,0" >
                            <Border.RenderTransform>
                                <TranslateTransform x:Name="PART_DropShadowTranslateTransform" X="5" Y="5" />
                            </Border.RenderTransform>
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                                    <GradientStop Color="#00000000" Offset="0" x:Name="PART_ShadowOuterStop1" />
                                    <GradientStop Color="#ff000000" Offset="0.1" x:Name="PART_ShadowVertical1"/>
                                    <GradientStop Color="#ff000000" Offset="0.9" x:Name="PART_ShadowVertical2"/>
                                    <GradientStop Color="#00000000" Offset="1" x:Name="PART_ShadowOuterStop2" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="1.0,0.5" StartPoint="0.0,0.5" MappingMode="RelativeToBoundingBox">
                                    <GradientStop Color="#00000000" Offset="0"/>
                                    <GradientStop Color="#FF000000" Offset="0.1" x:Name="PART_ShadowHorizontal1"/>
                                    <GradientStop Color="#FF000000" Offset="0.9" x:Name="PART_ShadowHorizontal2"/>
                                    <GradientStop Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <local:ClippingBorder Background="{TemplateBinding Background}" 
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Padding="{TemplateBinding Padding}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                ClipContent="{TemplateBinding ClipContent}">
                            <ContentPresenter />
                        </local:ClippingBorder>


                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- OuterGlowBorder style -->
    <Style TargetType="local:OuterGlowBorder">
        <Setter Property="OuterGlowSize" Value="10" />
        <Setter Property="OuterGlowOpacity" Value="0.5" />
        <Setter Property="OuterGlowColor" Value="#ff000000" />
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:OuterGlowBorder">
                    <Grid>
                        <Border Opacity="{TemplateBinding OuterGlowOpacity}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                   CornerRadius="{TemplateBinding ShadowCornerRadius}" x:Name="PART_OuterGlowBorder" IsHitTestVisible="False" >
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                                    <GradientStop Color="#00000000" Offset="0" x:Name="PART_ShadowOuterStop1" />
                                    <GradientStop Color="#ff000000" Offset="0.1" x:Name="PART_ShadowVertical1"/>
                                    <GradientStop Color="#ff000000" Offset="0.9" x:Name="PART_ShadowVertical2"/>
                                    <GradientStop Color="#00000000" Offset="1" x:Name="PART_ShadowOuterStop2" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="1.0,0.5" StartPoint="0.0,0.5" MappingMode="RelativeToBoundingBox">
                                    <GradientStop Color="#00000000" Offset="0"/>
                                    <GradientStop Color="#FF000000" Offset="0.1" x:Name="PART_ShadowHorizontal1"/>
                                    <GradientStop Color="#FF000000" Offset="0.9" x:Name="PART_ShadowHorizontal2"/>
                                    <GradientStop Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <local:ClippingBorder Background="{TemplateBinding Background}" 
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Padding="{TemplateBinding Padding}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                ClipContent="{TemplateBinding ClipContent}">
                            <ContentPresenter />
                        </local:ClippingBorder>


                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ClippingBorder style -->
    <Style TargetType="local:ClippingBorder">
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ClippingBorder">
                    <Border Background="{TemplateBinding Background}" 
                            CornerRadius="{TemplateBinding CornerRadius}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                                x:Name="PART_Border"
                                
                                >

                        <Grid>

                            <ContentControl x:Name="PART_TopLeftContentControl"
                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                                <ContentControl.Clip>
                                    <RectangleGeometry x:Name="PART_TopLeftClip" />
                                </ContentControl.Clip>

                                <ContentControl x:Name="PART_TopRightContentControl"  
                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                                    <ContentControl.Clip>
                                        <RectangleGeometry x:Name="PART_TopRightClip" />
                                    </ContentControl.Clip>

                                    <ContentControl x:Name="PART_BottomRightContentControl" 
                                                HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                                        <ContentControl.Clip>
                                            <RectangleGeometry x:Name="PART_BottomRightClip" />
                                        </ContentControl.Clip>

                                        <ContentControl x:Name="PART_BottomLeftContentControl" 
                                                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                                            <ContentControl.Clip>
                                                <RectangleGeometry x:Name="PART_BottomLeftClip" />
                                            </ContentControl.Clip>

                                            <ContentPresenter Margin="{TemplateBinding Padding}" />

                                        </ContentControl>

                                    </ContentControl>

                                </ContentControl>

                            </ContentControl>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- InnerGlowBorder style -->
    <Style TargetType="local:InnerGlowBorder">
        <Setter Property="InnerGlowSize" Value="10,10,10,10" />
        <Setter Property="InnerGlowOpacity" Value="0.5" />
        <Setter Property="InnerGlowColor" Value="#ff000000" />
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="ContentZIndex" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:InnerGlowBorder">
                    <local:ClippingBorder Background="{TemplateBinding Background}" 
                            CornerRadius="{TemplateBinding CornerRadius}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            ClipContent="{TemplateBinding ClipContent}">
                        <Grid>

                            <ContentPresenter Margin="{TemplateBinding Padding}" Canvas.ZIndex="{TemplateBinding ContentZIndex}" />

                            <Border x:Name="PART_LeftGlow" IsHitTestVisible="False" Canvas.ZIndex="0"
                                    Opacity="{TemplateBinding InnerGlowOpacity}"
                                    HorizontalAlignment="Left" VerticalAlignment="Stretch"
                                    Width="10">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0, 0.5" EndPoint="1, 0.5">
                                        <GradientStop Offset="0" Color="#ff000000" x:Name="PART_LeftGlowStop0" />
                                        <GradientStop Offset="1" Color="#00000000" x:Name="PART_LeftGlowStop1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border x:Name="PART_TopGlow" IsHitTestVisible="False" Canvas.ZIndex="0"
                                    Opacity="{TemplateBinding InnerGlowOpacity}"
                                    HorizontalAlignment="Stretch" VerticalAlignment="Top"
                                    Height="10">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
                                        <GradientStop Offset="0" Color="#ff000000" x:Name="PART_TopGlowStop0" />
                                        <GradientStop Offset="1" Color="#00000000" x:Name="PART_TopGlowStop1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border x:Name="PART_RightGlow" IsHitTestVisible="False" Canvas.ZIndex="0"
                                    Opacity="{TemplateBinding InnerGlowOpacity}"
                                    HorizontalAlignment="Right" VerticalAlignment="Stretch"
                                    Width="10">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="1, 0.5" EndPoint="0, 0.5">
                                        <GradientStop Offset="0" Color="#ff000000" x:Name="PART_RightGlowStop0" />
                                        <GradientStop Offset="1" Color="#00000000" x:Name="PART_RightGlowStop1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border x:Name="PART_BottomGlow" IsHitTestVisible="False" Canvas.ZIndex="0"
                                    Opacity="{TemplateBinding InnerGlowOpacity}"
                                    HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
                                    Height="10">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0.5, 1" EndPoint="0.5, 0">
                                        <GradientStop Offset="0" Color="#ff000000" x:Name="PART_BottomGlowStop0" />
                                        <GradientStop Offset="1" Color="#00000000" x:Name="PART_BottomGlowStop1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Grid>
                    </local:ClippingBorder>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- GlassBorder style -->
    <Style TargetType="local:GlassBorder">
        <Setter Property="GlassOpacity" Value="1" />
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="ContentZIndex" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:GlassBorder">
                    <local:ClippingBorder Background="{TemplateBinding Background}" 
                            CornerRadius="{TemplateBinding CornerRadius}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            ClipContent="{TemplateBinding ClipContent}">
                        <Grid>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>

                            <ContentPresenter Margin="{TemplateBinding Padding}" Canvas.ZIndex="{TemplateBinding ContentZIndex}" Grid.RowSpan="2" />

                            <Border Opacity="{TemplateBinding GlassOpacity}" CornerRadius="{TemplateBinding GlassCornerRadius}" Margin="1,1,1,0">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Color="#ffffffff" Offset="0" />
                                        <GradientStop Color="#C4ffffff" Offset="0.05" />
                                        <GradientStop Color="#54ffffff" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Grid>
                    </local:ClippingBorder>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- PerspeciveShadowBorder style -->
    <Style TargetType="local:PerspectiveShadowBorder">
        <Setter Property="PerspectiveShadowOpacity" Value="0.5" />
        <Setter Property="PerspectiveShadowColor" Value="#ff000000" />
        <Setter Property="PerspectiveShadowAngle" Value="-15" />
        <Setter Property="PerspectiveShadowSpread" Value="0" />
        <Setter Property="ClipContent" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PerspectiveShadowBorder">
                    <Grid>
                        <Border Opacity="{TemplateBinding PerspectiveShadowOpacity}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                   CornerRadius="{TemplateBinding ShadowCornerRadius}" IsHitTestVisible="False" RenderTransformOrigin="0,1" >
                            <Border.RenderTransform>
                                <TransformGroup>
                                    <SkewTransform AngleX="-15" AngleY="0" x:Name="PART_PerspectiveShadowSkewTransform" />
                                    <ScaleTransform ScaleX="1" ScaleY="1" x:Name="PART_PerspectiveShadowScaleTransform" />
                                </TransformGroup>
                            </Border.RenderTransform>
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                                    <GradientStop Color="#00000000" Offset="0" x:Name="PART_ShadowOuterStop1" />
                                    <GradientStop Color="#ff000000" Offset="0.1" x:Name="PART_ShadowVertical1"/>
                                    <GradientStop Color="#ff000000" Offset="0.9" x:Name="PART_ShadowVertical2"/>
                                    <GradientStop Color="#00000000" Offset="1" x:Name="PART_ShadowOuterStop2" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="1.0,0.5" StartPoint="0.0,0.5" MappingMode="RelativeToBoundingBox">
                                    <GradientStop Color="#00000000" Offset="0"/>
                                    <GradientStop Color="#FF000000" Offset="0.1" x:Name="PART_ShadowHorizontal1"/>
                                    <GradientStop Color="#FF000000" Offset="0.9" x:Name="PART_ShadowHorizontal2"/>
                                    <GradientStop Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <local:ClippingBorder Background="{TemplateBinding Background}" 
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Padding="{TemplateBinding Padding}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                ClipContent="{TemplateBinding ClipContent}">
                            <ContentPresenter />
                        </local:ClippingBorder>


                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- ********** PANEL STYLES ********** -->
    <!-- DragDockPanel style -->
   <Style TargetType="local:DragDockPanel">
        <Setter Property="Background" Value="#ff000000" />
        <Setter Property="BorderBrush" Value="#ff333333" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DragDockPanel">
                    <Grid>

                        <!-- Border with white background -->
                        <local:OuterGlowBorder 
                            OuterGlowOpacity="0.4" OuterGlowSize="15"
                            CornerRadius="3,3,3,3" 
                            Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                    >
                            <local:InnerGlowBorder
                                    InnerGlowOpacity="1" CornerRadius="3,3,3,3" InnerGlowColor="#11ffffff" InnerGlowSize="15,15,0,0" Margin="0" Padding="2" ClipContent="True"
                                    Background="Transparent" BorderThickness="0">
                                <Grid>

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>

                                    <!-- Content presenter for hosting the content -->
                                    <ContentPresenter Grid.Row="1"
                                                      Content="{TemplateBinding Content}"
                                                      ContentTemplate="{TemplateBinding ContentTemplate}"/>

                                    <!-- 
                  Element named PART_GripBar for 
                  handling the dragging of the panel  
                  -->

                                    <Border Background="#7f000000" Margin="-2" Padding="3">
                                        <Grid>
                                            <!--<Border x:Name="GripBarElement"   CornerRadius="3,3,0,0" Background="#00ffffff" VerticalAlignment="Top" MinHeight="30" Cursor="Hand"
                                            Margin="0,0,32,0" IsHitTestVisible="{TemplateBinding DraggingEnabled}">-->
                                            <Border x:Name="GripBarElement"   CornerRadius="3,3,0,0" Background="#00ffffff" VerticalAlignment="Top" MinHeight="30" Cursor="Hand"
                                            Margin="0,0,32,0">
                                                <Grid>
                                                    <Rectangle Opacity="0.5" >
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint="6.58300018310547,6.08300018310547" StartPoint="2.31500005722046,1.81500005722046" 
                                           SpreadMethod="Repeat" MappingMode="Absolute">
                                                                <GradientStop Color="#FFAFAFAF" Offset="0"/>
                                                                <GradientStop Color="#00FFFFFF" Offset="1"/>
                                                                <GradientStop Color="#00FFFFFF" Offset="0.339"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <ContentPresenter Content="{TemplateBinding Header}" 
                                                              ContentTemplate="{TemplateBinding HeaderTemplate}" />

                                                </Grid>
                                            </Border>

                                            <ToggleButton x:Name="MaximizeToggleButton" 
                              VerticalAlignment="Top" HorizontalAlignment="Right"
                              Margin="0,5,5,0" Width="20" Height="20" Cursor="Hand">
                                                <ToggleButton.Template>
                                                    <ControlTemplate TargetType="ToggleButton">
                                                        <Border Background="#7F000000" CornerRadius="2,2,2,2">
                                                            <VisualStateManager.VisualStateGroups>
                                                                <VisualStateGroup x:Name="FocusStates">
                                                                    <VisualState x:Name="Focused"/>
                                                                    <VisualState x:Name="Unfocused"/>
                                                                </VisualStateGroup>
                                                                <VisualStateGroup x:Name="CommonStates">
                                                                    <VisualState x:Name="Disabled"/>
                                                                    <VisualState x:Name="Normal"/>
                                                                    <VisualState x:Name="MouseOver">
                                                                        <Storyboard>
                                                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.6"/>
                                                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.3"/>
                                                                            </DoubleAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                    </VisualState>
                                                                    <VisualState x:Name="Pressed">
                                                                        <Storyboard>
                                                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.15"/>
                                                                            </DoubleAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                    </VisualState>
                                                                </VisualStateGroup>
                                                                <VisualStateGroup x:Name="CheckStates">
                                                                    <VisualState x:Name="Checked">
                                                                        <Storyboard>
                                                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="checkedArrow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                                            </DoubleAnimationUsingKeyFrames>
                                                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="uncheckedArrow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                                            </DoubleAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                    </VisualState>
                                                                    <VisualState x:Name="Unchecked">
                                                                        <Storyboard/>
                                                                    </VisualState>
                                                                    <VisualState x:Name="Indeterminate"/>
                                                                </VisualStateGroup>
                                                            </VisualStateManager.VisualStateGroups>
                                                            <Grid Height="Auto" Width="Auto">
                                                                <Border Margin="0,0,0,0" BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1" Width="16" Height="16">
                                                                    <Grid>
                                                                        <Path HorizontalAlignment="Right" Margin="0,1.24500000476837,1.70700001716614,5.375" x:Name="uncheckedArrow" VerticalAlignment="Stretch" Width="6.752" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0.5,1.005 L6.2509999,1.005 M6.25,6.8800006 L6.25,0.5 M6.2520003,1.0880001 L0.50000024,6.8800001" />
                                                                        <Path HorizontalAlignment="Stretch" Margin="1.45899999141693,5.74200010299683,5.78900003433228,0.878000020980835" x:Name="checkedArrow" VerticalAlignment="Stretch" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0.5,1.005 L6.2509999,1.005 M6.25,6.8800006 L6.25,0.5 M6.2520003,1.0880001 L0.50000024,6.8800001" Opacity="0" RenderTransformOrigin="0.5,0.5">
                                                                            <Path.RenderTransform>
                                                                                <TransformGroup>
                                                                                    <ScaleTransform/>
                                                                                    <SkewTransform/>
                                                                                    <RotateTransform Angle="180"/>
                                                                                    <TranslateTransform/>
                                                                                </TransformGroup>
                                                                            </Path.RenderTransform>
                                                                        </Path>
                                                                    </Grid>
                                                                </Border>
                                                                <Rectangle Fill="#FFFFFFFF" RadiusX="2" RadiusY="2" Margin="1,1,1,1" Opacity="0" x:Name="rectangle"/>
                                                            </Grid>
                                                        </Border>
                                                    </ControlTemplate>
                                                </ToggleButton.Template>
                                            </ToggleButton>
                                        </Grid>
                                    </Border>



                                </Grid>
                            </local:InnerGlowBorder>
                        </local:OuterGlowBorder>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <local:DropShadowTextBlock Text="{Binding}"
                                                  FontFamily="Verdana"
                                                  FontSize="14"
                                                  VerticalAlignment="Center"
                                                  Margin="5"
                                                  DropShadowDistance="3"
                                                  DropShadowAngle="45"
                                                  Foreground="#ffffffff"
                        />
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

   
</ResourceDictionary>
